import java.io.*;
import java.util.*;
import java.lang.*;



public class MathOne{
	ArrayList<Tuple> inOut;
	
	public MathOne(ArrayList<Tuple> inOut){
		this.inOut = inOut;
	}
	public void findMath(){

		int a = inOut.get(0).get(1).get(0).intValue();
		int b = inOut.get(0).get(2).get(0).intValue();

		boolean t=false;
		double test = add(a,b);
		if (test != 0){
			System.out.println("Addition with constant "+test);
			t=true;
		}
		test = mul(a,b);
		if (test != 0){
			System.out.println("Multiplication with constant "+test);
			t=true;
		}
		test = divN(a,b);
		if (test != 0){
			System.out.println("Division with constant "+test+" as numerator");
			t=true;		
		}
		test = divD(a,b);
		if (test != 0){
			System.out.println("Division with constant "+test+" as denominator");
			t=true;		
		}
		if(t==false)
			System.out.println("No idea");
		
		

	}
	private double add(int a, int b){
		double konst = b-a;
		for(int i=0; i<inOut.size(); i++){
			a = inOut.get(i).get(1).get(0).intValue();
			b = inOut.get(i).get(2).get(0).intValue();
			double k = b-a;
			if (k != konst)
				return 0;
		}
		return konst;
	}

	private double mul(int a, int b){
		double konst = b/a;
		for(int i=0; i<inOut.size(); i++){
			a = inOut.get(i).get(1).get(0).intValue();
			b = inOut.get(i).get(2).get(0).intValue();
			double k = b/a;
			if (k != konst)
				return 0;
		}
		return konst;
	}

	private double divN(int a, int b){
		double konst = b*a;
		for(int i=0; i<inOut.size(); i++){
			a = inOut.get(i).get(1).get(0).intValue();
			b = inOut.get(i).get(2).get(0).intValue();
			double k = b*a;
			if (k != konst)
				return 0;
		}
		return konst;
	}
	
	private double divD(int a, int b){
		double konst = a/b;
		for(int i=0; i<inOut.size(); i++){
			a = inOut.get(i).get(1).get(0).intValue();
			b = inOut.get(i).get(2).get(0).intValue();
			double k = a/b;
			if (k != konst)
				return 0;
		}
		return konst;
	}
}
